﻿{include file="Public/public" /}
<body>
 <div class="wrap">
  <div class="page-title">
    <span class="modular fl"><i></i><em>轮播图列表</em></span>
    <span class="modular fr"><a href="/adminnews/addlunbo" class="pt-link-btn">+添加轮播图</a></span>
  </div>
  <table class="list-style Interlaced">
   <tr>
    <th>ID编号</th>
    <th>缩略图</th>
    <th>状态</th>
    <th>标题</th>
    <th>操作</th>
   </tr>
   
    
   {foreach name="lunbo" item="rows"}
   <tr>
    <td class="center pic-area">
     <span>
   {$rows.id}
     </span>
    </td>
    <td class="center pic-area"><img src="/uploads/{$rows['pic']}" class="thumbnail"/></td>
    <td class="center pic-area">
     {if condition="$rows['status']==1"}使用{else/}禁用{/if}
    </td>
    <td class="center pic-area">{$rows['title']}</td>
    <td class="center pic-area">
     <a href="/adminnews/editlunbo/id/{$rows.id}" title="编辑"><img src="/static/admin/mo/images/icon_edit.gif"/></a>
     <a href="javascript:void(0);" onclick="bin(this)" id="{$rows.id}" title="删除"><img src="/static/admin/mo/images/icon_drop.gif"/></a>
    </td>
   </tr>
  {/foreach}
  </table>
 </div>
</body>
</html>
<script> 
function bin(ob){
  var id=ob.id;
  var ss=confirm('确定要删除?');
  if(ss){
    $.get("/adminnews/deletelunbo",{id:id},function(data){
       if(data){
        alert('删除成功');
        location.href="/adminnews/lunbo";
       }else{
        alert('删除失败');
        location.href="/adminnews/lunbo";
       }
    })
  }
}       
</script>  